import React from 'react';
import { FILTER_SHOW_ACTIVE, FILTER_SHOW_ALL, FILTER_SHOW_COMPLETED,setVisibilityFilter } from '../actions';
//过滤组件
const Filter = ({ dispatch,children }) => {
    let onClick = (filter) => {
        console.log(filter);
        dispatch(setVisibilityFilter(filter));
    }
    return <div>
        <span><input type='radio' name="filter" onClick={e => onClick(FILTER_SHOW_ALL)}></input>{FILTER_SHOW_ALL}</span><br/>
        <span><input type='radio' name="filter" onClick={e => onClick(FILTER_SHOW_ACTIVE)}></input>{FILTER_SHOW_ACTIVE}</span><br/>
        <span><input type='radio' name="filter" onClick={e => onClick(FILTER_SHOW_COMPLETED)}></input>{FILTER_SHOW_COMPLETED}</span>
       
    </div>
}

export default Filter